﻿<%@ Page Title="" Language="VB" MasterPageFile="~/admin/AdminMaster.master" AutoEventWireup="false" CodeFile="AdminProducts.aspx.vb" Inherits="admin_AdminProducts" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <style type="text/css">
        .style1
        {
            width: 50px;
        }
        .style2
        {
            width: 67px;
        }
        .style3
        {
            width: 68px;
        }
        .style4
        {
            width: 105px;
        }
    </style>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>

        <asp:GridView ID="grvProducts" runat="server" AutoGenerateColumns="False" 
            cssClass="Gridview" DataSourceID="AccessDataSource1" AllowPaging="True" 
                DataKeyNames="ProductID">
            <Columns>
                <asp:BoundField DataField="ProductID" HeaderText="ID" 
                    SortExpression="ProductID" InsertVisible="False" ReadOnly="True" />
                <asp:BoundField DataField="ProductName" HeaderText="Product Name" 
                    SortExpression="ProductName" />
                <asp:BoundField DataField="ProductDesc" HeaderText="Description" 
                    SortExpression="ProductDesc" />
                <asp:BoundField DataField="Amount" HeaderText="Amount" 
                    SortExpression="Amount" >
                <ItemStyle HorizontalAlign="Right" />
                </asp:BoundField>
                <asp:BoundField DataField="CategoryID" HeaderText="CategoryID" 
                    SortExpression="CategoryID" />
                <asp:CheckBoxField DataField="CanPersonalize" HeaderText="Personalize" 
                    SortExpression="CanPersonalize" >
                <ItemStyle HorizontalAlign="Center" />
                </asp:CheckBoxField>
                <asp:CheckBoxField DataField="IsVisible" HeaderText="Visible" 
                    SortExpression="IsVisible" >
                <ItemStyle HorizontalAlign="Center" />
                </asp:CheckBoxField>
                <asp:BoundField DataField="ImagePath" HeaderText="Image Path" 
                    SortExpression="ImagePath" />
            </Columns>
        </asp:GridView>
        <div>
            <asp:Button ID="btnAddNewProduct" runat="server" Text="Add New Product" 
                cssClass="btn" CausesValidation="False"/>
        </div>
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" 
            DataFile="~/App_Data/GotPink.accdb" 
            
            SelectCommand="SELECT * FROM [Products]">
        </asp:AccessDataSource>

    <asp:Panel ID="pnlAddProduct" runat="server" Width="600px">
        <div class="ModalPopup">
        <h2>Add New Product</h2>
        <table style="width: 600px; font-size: 14px" cellspacing="20">
            <tr>
                <td style="text-align:right" class="style1">
                    <asp:RequiredFieldValidator ID="vldReqName" runat="server" 
                        ControlToValidate="txtName" CssClass="validate" Display="Dynamic" 
                        ErrorMessage="Name is required">*</asp:RequiredFieldValidator>
                    Name
                </td>
                <td class="style1">
                    <asp:TextBox ID="txtName" runat="server" Width="125px"></asp:TextBox>
                </td>
                <td style="text-align:right" class="style1">
                    <asp:RequiredFieldValidator ID="vldReqAmount" runat="server" 
                        ControlToValidate="txtAmount" CssClass="validate" Display="Dynamic" 
                        ErrorMessage="Amount is required">*</asp:RequiredFieldValidator>
                    Amount
                </td>
                <td class="style1">
                    <asp:TextBox ID="txtAmount" runat="server" Width="125px"></asp:TextBox>
                </td>
               
           </table>

           <table style="width: 550px" cellspacing="20">
                <tr>
                <td style="text-align:right">
                    Category 
                </td>
                <td>
                    <asp:DropDownList ID="ddlCategory" runat="server" 
                        DataSourceID="AccessDataSource2" DataTextField="CategoryName" 
                        DataValueField="CategoryName" Width="125px">
                    </asp:DropDownList>
                </td>
                <td style="text-align:right">
                    Is Visible
                </td>
                <td>
                    <asp:CheckBox ID="chkIsVisible" runat="server" Checked="True" />
                </td>
                <td style="text-align:right">
                    Personalize</td>
                <td>
                    <asp:CheckBox ID="chkPersonlize" runat="server" />
                </td>
                </tr>
           </table>


           <table style="width:600px" cellspacing="20">
           <tr>      
                <td style="text-align:right; " class="style4">
                    <asp:RequiredFieldValidator ID="vldReqImageBrowser" runat="server" 
                        ControlToValidate="fupImageBrowser" CssClass="validate" Display="Dynamic" 
                        ErrorMessage="Please upload an image ">*</asp:RequiredFieldValidator>
                    Image 
                </td>
                <td class="style3">
                    <asp:FileUpload ID="fupImageBrowser" runat="server" />
                </td>
            </tr>
            <tr>
                <td style="text-align:right; " class="style4">
                    <asp:RequiredFieldValidator ID="vldReqDescription" runat="server" 
                        ControlToValidate="txtDescription" CssClass="validate" Display="Dynamic" 
                        ErrorMessage="Description is required">*</asp:RequiredFieldValidator>
                    &nbsp;Description</td>
                <td style="width:600px">
                    <asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine" 
                        Width="300px"></asp:TextBox>
                </td>
             </tr>
             </table>
             <table style="width: 600px; text-align:center" cellspacing="20">
                 <tr>
                     <td>
                         <asp:Button ID="btnSubmit" runat="server" Text="Submit" CssClass="btn" Width="100px" />
                     </td>
                     <td>
                         <asp:Button ID="btnClear" runat="server" Text="Clear" CssClass="btn" 
                             Width="100px" CausesValidation="False" />
                     </td>
                     <td>
                         <asp:Button ID="btnDone" runat="server" Text="Done" CssClass="btn" 
                             Width="100px" CausesValidation="False" />
                     </td>
                 </tr>
            </table>
            <table style="width:100%; text-align:center">
                <tr>
                    <td>
                        
                        <asp:ValidationSummary ID="vldSummary" runat="server" CssClass="validate" 
                            DisplayMode="List" />
                    </td>
                </tr>
            </table>
           <div>
            
           </div>
        <asp:AccessDataSource ID="AccessDataSource2" runat="server" 
                        DataFile="~/App_Data/GotPink.accdb" 
                        SelectCommand="SELECT [CategoryName] FROM [Category]">
                    </asp:AccessDataSource>
             </div>
         
    </asp:Panel>
    <ajaxToolkit:ModalPopupExtender ID="ajxModalPopup" runat="server" 
            BackgroundCssClass="ModalPopupBG" 
            PopupControlID="pnlAddProduct" TargetControlID="btnAddNewProduct">
    </ajaxToolkit:ModalPopupExtender>
    
    </ContentTemplate>
</asp:UpdatePanel>
</asp:Content>

